#include <stdio.h>
#include <stdlib.h> //for free
#include "slist.h"

void testAtFront(sNode_t **list) {

    //test insertAtFront
    for(int i=1;i<10;i++) {
        insertAtFront(list, i);
    }
    printList(*list);
}

void testAtTail(sNode_t *list) {

    //test insertAtFront
    for(int i=1;i<10;i++) {
        insertAtTail(&list, i);
    }
    printList(list);
}


int main() {
    sNode_t *list=NULL;


    testAtFront(&list);

    sNode_t *ptrNode = NULL;
    while(list!=NULL) {
        ptrNode = deleteFromFront(&list);
        printf("%d\n", ptrNode->data);
        free(ptrNode); 
    }

    testAtTail(list);
    printf("list address %p\n", list);
}